package com.wanbatv.wangwangba.util;





import java.io.IOException;

import okhttp3.OkHttpClient;
import okhttp3.Request;

/**
 * Created by 俞亚楠 on 2016/7/20.
 */
public class HeaderClient {
    public static OkHttpClient genericClient() {
        OkHttpClient httpClient = new OkHttpClient.Builder()
                .addInterceptor(new okhttp3.Interceptor() {
                    @Override
                    public okhttp3.Response intercept(Chain chain) throws IOException {
                        Request request=chain.request()
                                .newBuilder()
                                .addHeader("accept","application/vnd.com.wanbatv.wangwangba;version="+Product.versionName)
                                .addHeader("app_version",Product.versionName)
                                .addHeader("app_package_name",Product.packageName)
                                .build();
                        return chain.proceed(request);
                    }
                })
                .build();

        return httpClient;
    }
}
